package cn.com.cifi.mars.service;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.IService;

import cn.com.cifi.mars.bean.dto.VersionTypeCountDto;
import cn.com.cifi.mars.bean.vo.price.ApprovedDiffDetailVO;
import cn.com.cifi.mars.entity.ApprovalBill;
import cn.com.cifi.mars.entity.ApprovalShot;
import cn.com.cifi.mars.entity.ApprovalVersionCompare;
import cn.com.cifi.mars.entity.PriceValueOrg;
import cn.com.cifi.mars.entity.PriceVersion;
import cn.com.cifi.mars.entity.common.ProjectByStages;

public interface SubmitApprovedProjectService extends IService<PriceVersion> {

	List<ApprovalVersionCompare> goodsValueMethod(String projectId);

	// 根据projectId查询需要审批的项目的分期
	List<PriceVersion> selectApprovedProject(String projectId);

	// 根据projectId查询项目下所有分期的所有版本的个数
	List<VersionTypeCountDto> selectVersionTypeCount(String projectId);

	// 根据projectId查询项目下所有审批通过的分期
	List<ProjectByStages> selectApprovedStageCount(String projectId);

	// 根据projectId查询需要展示的货值的id
	List<PriceVersion> selectVersionId(String projectId, String versionType);

	// 查询项目下是否有审批通过的stage
	int selectVersionType(String projectId, String versionType, String stageId);

	// 查询项目下的分期
	List<String> getProjectfIds(String projectId);

	// 查询调整后动态货值
	List<Map<String, Object>> selectAdjustBefore(String projectfId, String type);

	// 提交到OA审批时保存业务相关数据
	ApprovalBill saveBusinessData(String projectId, String businessType, String flowKey, String account,
			String postCode, String orgCode, String description, String subject, String name);

	void updateApprovalState(String businessKey, String state, String instId, String taskId, LocalDateTime dateTime);

	// 审批校验
	List<PriceVersion> checkApprovedVersion(String projectId);

	// 审批校验
	int checkApprovedVersionIsNull(String projectId);

	// 根据businessKey查询approval_bill
	ApprovalBill selectApprovalBillByKey(String businessKey);

	String selectFlowKey(String orgName, String businessType);

	String getFlowKey(String businessType, String projectId);

	// 提交到OA审批校验-查询是否有审批中的版本
	List<PriceVersion> checkSubmitToOA(String projectId);

	// 新建版本校验
	Boolean checkNewVersion(String projectfId);

	// 根据bussinesKey和collect_type查询t_approval_version_compare
	List<String> selectVersionIdByKey(String key, String CollectType);

	// 根据versionId和层级类型查询t_price_value_org中的货值
	void saveApprovedShot(List<String> ids, String type, String key);

	// 根据businessKey和versionId查询快照
	ApprovalShot selectShotInfo(String BussinesKey, String VersionId);

	// 根据businessKey更新审批说明
	void updateDescByBusinessKey(String BussinesKey, String description, String flowKey,String account,String name);

	List<PriceVersion> selectPriceVersionByFId(String stageId, String key, List<String> states);

	// 根据projectId查询approval_bill
	ApprovalBill selectApprovalBillByProjectId(String projectId,String bussinesType);
	
	List<ApprovedDiffDetailVO> differenceDetailResultData(String projectId,String businessKey,String type);

	List<PriceValueOrg> selectPriceValueOrgList(String projectId, String type);

	List<PriceVersion> selectVersionByBillId(String instanceId);

	boolean stageStateInfo(String projectfId);
}
